﻿using GraphShape.Controls;
using Microsoft.Xaml.Behaviors;

namespace KinonekoSoftware.Studio.Resources.Behaviors
{
    public sealed class GraphLayoutMethodWithISOMBehavior : Behavior<MenuItem>
    {
        protected override void OnAttached()
        {
            if (AssociatedObject.CommandParameter is GraphLayout gl && AssociatedObject.Tag is string method)
            {
                gl.LayoutAlgorithmType = method;
            }
            
            base.OnAttached();
        }
    }
}